The dopus read provides ARexx control of the internal
Opus viewer.
You can use it to view any type of file on your system, using the normal
reader menus to switch between modes, call an editor, etc.
When you open a viewer from ARexx, a handle will be returned in the
ARexx RESULT variable, much the same as for opening listers. Having a handle
will allow you to load new files into an already open viewer, or close an
open viewer.
Specifying the delete keyword will cause the file being viewed
to be deleted when you close the reader. This makes it useful for viewing
temporary files, or intermediate results.
Example:
/* DopusRead.dopus5 */
options results
address 'DOPUS.1'
address command 'Copy file://localhost/DOPLUS:Tutorial/ARexx Tutorial/TuteRexx/DOpusRead.dopus5 RAM: QUIET'
"dopus read delete pos 50/50/200/100 RAM:DOpusRead.dopus5"
text = 'The reader''s handle is: 'result
dopus request '"'text'" OK'
text = 'The file ''RAM:DOpusRead.dopus5'' will be deleted when you close the viewer.'
dopus request '"'text'" OK'
exit
NOTE: Because we have included a position for the viewer to open in, (pos
50/50/200/100), it will be necessary to put the whole command within
quotes so ARexx doesn't interpret 50/50/200/100 as a mathematical
expression.
In the following example, we'll open the viewer in hex mode and then close
it using it's handle.
Example:
/* DopusRead2.dopus5 */
options results
address 'DOPUS.1'
dopus read hex 'C:LoadWB'
handle = result
text = 'The reader''s handle is: 'handle
dopus request '"'text'" OK'
address command wait 3
dopus read handle quit
exit
|